<?= $this->element('finance_submenu', array('page'=>'cycle'))?>
<p><?= $this->Html->link("+" . __('new') . " " . __('cycle'), array('action'=>'create_cycle')) ?></p>

<? if(count($data)>0): ?>
<table>
	<tr>
		<th width="1%"><?= __('id') ?></th>
		<th width="13%"><?= __('date') ?></th>
		<th><?= __('amount') ?></th>
		<th width="1%"></th>
	</tr>
	<? foreach($data as $row): ?>
	<tr>
		<td><?= $this->Html->link(sprintf("%04d", $row['FinanceCycle']['id']), "/finance/edit_cycle/" . $row['FinanceCycle']['id']) ?></td>
		<td><?= date('d.M Y', strtotime($row['FinanceCycle']['date'])) ?></td>
		<td><?= number_format($row['FinanceCycle']['amount'], 2, ",", ".") ?></td>
		<td>
			<?= $this->Html->link(__('delete'), array('action'=>'delete_cycle', $row['FinanceCycle']['id']), array('onclick'=>"return confirm('".__("Do you want to delete cycle?")."')")) ?>
		</td>
	</tr>
	<? endforeach; ?>
</table>
<?= $this->element('pagination') ?>
<? else: ?>
<p><?= __('There\'s no cycles') ?>.</p>
<? endif; ?>